Przejdź do głównej zawartości

Errors

Errors are returned by throwing IntegratorException specifically built for this use. Thrown exception is then caught in exception middleware which detects its type (handled or unhandled) and returns appropriate HTTP response with its body.

Error response

{
"statusCode": "string",
"reason": "string",
"messages": ["string"]
}

In addition to HTTP codes, a x-correlation-id header has been implemented so that the user can receive a unique identifier for his request, which can be used to report errors to the development team.

Status codes

Status codes are a way to distinguish exactly what happened during the processing of a request. They are helpful because for ex. HTTP 400 codes are not enough to properly inform the user of what happened.

Structure

Status codes are 5 digits. The first two digits and the last three are separated by a dash. The first two digits specify the part of the application from which the error was thrown. The remaining digits are the next number from the previous status code.

xx-yyy

xx:
Global: 01
Integrator.Api: 02
Integrator.DataAccess: 03
Integrator.Domain: 04
Integrator.Shared: 05